''' cookie操作'''
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.youdao.com')

'''
# 获得cookie信息
cookie = driver.get_cookies()
# 将获得cookie信息打印
print(cookie)
'''

# 向cookie的name和value中添加会话信息
driver.add_cookie({'name':'key-aaa','value':'value-bbb'})
for cookie in driver.get_cookies():
    print("%s -> %s" %(cookie['name'],cookie['value']))

driver.quit()